/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 *
 * @author: jin Chen 
 * @date: Sep 15, 2004$
 * @version: 1.0
 */
package edu.psu.geovista.app.pcp.toolkits.table;

import edu.psu.geovista.app.pcp.plot.control.DfActionManager;

import javax.swing.*;
import java.net.URL;

public class TableConstants {
    public static final boolean DEBUG=false;
    static String MODEL_ROOT;
    static String IMAGES;
    static String RESOURCES="resources/";

    static{
         String bp=TableConstants.class.getPackage().getName() ;
         String bpkg=bp.replace('.','/');
         bpkg=bpkg+'/';
         MODEL_ROOT=bpkg;
         IMAGES=MODEL_ROOT+RESOURCES+"images/";

    }

    // loading images
    public static ImageIcon getImageIcon(String name) {
        String fullName=IMAGES+name+".gif";
        ClassLoader cl=DfActionManager.class.getClassLoader() ;
        URL url=cl.getResource(fullName);
        if (url == null) {
            //dp{
            if (DEBUG){
               System.out.println("image "+fullName+" not found");
            }//dp}

            return null;
        }
        return new ImageIcon(url);
    }


}
